package com.yxx.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yxx.entity.Menu;
import com.yxx.entityModel.vo.query.MenuQuery;
import com.yxx.entityModel.vo.request.MenuRequest;
import com.yxx.entityModel.vo.response.MenuOptionResponse;
import com.yxx.entityModel.vo.response.MenuResponse;
import com.yxx.entityModel.vo.response.MenuTreeResponse;
import com.yxx.entityModel.vo.response.UserMenuResponse;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author yuxiangxun
 * @date 2025/1/19
 * @apiNote
 */
@Repository
public interface MenuMapper extends BaseMapper<Menu> {
    /**
     * 根据角色id查询对应权限
     * @param roleId id
     * @return 权限标识
     */
    List<String> selectPermissionByRoleId(@Param("roleId") String roleId);

    /**
     * 根据校验完后的userId查询用户菜单
     * @param userId
     * @return
     */
    List<UserMenuResponse> selectMenuByUserId(@Param("userId") Integer userId);

    /**
     * 查询菜单列表
     * @param menuQuery 菜单查询条件
     * @return 菜单列表
     */
    List<MenuResponse> selectMenuVOList(@Param("param")  MenuQuery menuQuery);

    /**
     * 查询菜单信息
     * @return
     */
    List<MenuTreeResponse> selectMenuTree();

    /**
     * 查询菜单选项树
     * @return
     */
    List<MenuOptionResponse> selectMenuOptions();

    /**
     * 根据id查询菜单信息
     * @param menuId
     * @return
     */
    MenuRequest selectMenuById(@Param("menuId") Integer menuId);
}
